<template>
  <div class="form-preview-group form-textarea-preview">
    <label>
      {{_displayName}} 
      <span class="form-preview-notNull" v-if="showRequired">*</span>
      <i class="iconfont icon-yidongduanxianshi" v-if="field.isAppShow === 1"></i>
    </label>
  </div>
</template>

<script>
import { previewProps } from '@src/component/form/components/props';
import translate from '@src/component/form/mixin/translate.js'

export default {
  name: 'form-richtext-preview',
  mixins: [translate],
  props: previewProps,
  computed: {
    disabled() {
      let field = this.field;
      return field.disabled ||
        (field.setting && field.setting.defaultValueConfig && !!field.setting.defaultValueConfig.isNotModify && !!field.defaultValue);
    },
    showRequired() {
      let field = this.field;
      return field.isNull == 0 && !this.disabled;
    }
  }
}
</script>

<style lang="scss">
.form-textarea-preview{
  .form-preview-control{
    height: 68px;
    white-space: normal;
  }
}
</style>
